package demo1104.demo01;

import java.util.function.Consumer;

/**
 * @author JYH
 * @version 1.0
 * @date 2022/11/4 9:48
 */
public class TestStatic {
    public static void main(String[] args) {
        //Consumer<int[]> consumer=ints -> Test.sum(ints);
        Consumer<int[]> consumer=TestStatic::sum;

        int[] arr={1,3,4,5};
        consumer.accept(arr);
    }
    public static void sum(int [] arr){
        int sum=0;
        for (int i : arr) {
            sum+=i;
        }
        System.out.println(sum);
    }
}
